﻿using System;
using Telerik.Windows.Controls;
using TruckScale.Models;

namespace TruckScale.ViewModels
{
  public class UploadViewModel : ViewModelBase
  {
    private bool _uploadEnable;
    private string _uploadMachineCode;

    public string Theme { get; set; } = Global._weighConfig["Theme"];
    public string MainFontSize { get; set; } = Global._weighConfig["MainFontSize"];
    public bool UploadEnable
    {
      get => _uploadEnable; set
      {
        _uploadEnable = value;
        WeighConfigModel.UpdateConfig("UploadEnable", value.ToString());
      }
    }
    public string UploadMachineCode
    {
      get => _uploadMachineCode; set
      {
        _uploadMachineCode = value;
        WeighConfigModel.UpdateConfig("UploadMachineCode", value);
      }
    }

    public UploadViewModel()
    {
      UploadEnable = Convert.ToBoolean(Global._weighConfig["UploadEnable"]);
      UploadMachineCode = Global._weighConfig["UploadMachineCode"];
    }
  }
}
